﻿@{
    Layout = "~/Areas/Web/Views/Shared/_UserCenter.cshtml";
    ViewBag.Title = "我的积分";
}
@model  IEnumerable<Himall.Model.MemberIntegralRecord>
@using Himall.Model;
@using Himall.Core;
@{var type = Request.QueryString["type"];}


<div class="box1 lh24">
    <div class="title bot-border">
        <span class="title_txt curr">我的积分</span>
        <span class="title_txt"><a href="@Url.Action("OrderList")">礼品兑换管理</a></span>
    </div>
	<div class="border-box" style="margin-bottom:15px;;">
		<div id="describe" style="padding: 15px;">
			<div class="fl">
				<p>您当前可用积分：  @ViewBag.Integral 分 <a class="ftx-05" href="@Url.Action("IntegralRule")">如何获取积分？</a></p>
				
				<p>
					@if (@ViewBag.IntegralPerMoney != 0)
					{
						<label>可抵扣订单金额：@(ViewBag.Integral / ViewBag.IntegralPerMoney) 元</label><br />
						<span>
	
							积分使用说明：1、每 @ViewBag.IntegralPerMoney 积分可抵扣1元； 2、如订单发生退款、退货等问题时，获得的积分将被扣除。
						</span> }
				</p>
			</div>
			<div class="clr"></div>
		</div>
	</div>

	<ul class="cl two-title" id="ulstatus">
      <li  @(string.IsNullOrEmpty(type)? "class=active":"")><a href="?type=">全部</a></li>
  
		@foreach (var d in Himall.Core.EnumHelper.ToDescriptionDictionary<Himall.Model.MemberIntegral.IntegralType>())
        {
            if (type == d.Key.ToString())
            {
                <li class="active"><a href="?type=@d.Key">@d.Value</a></li>
            }
            else
            {
                <li><a href="?type=@d.Key">@d.Value</a></li>
            }
		}
	</ul>
    <div class="border-box" style="margin:0;">
        <table class="tb-void tb-goods">
            <thead>
                <tr class="tr-td">
                    <th width="150">来源/用途</th>
                    <th>积分</th>
                    <th width="200">时间</th>
                    <th width="500">备注</th>
                </tr>
            </thead>
            <tbody>
                @if (Model.Count() == 0)
                {
                    <tr><td colspan="8"><div class="empty"><b></b>暂时该积分记录！</div></td></tr>
                }
                @foreach (var m in Model)
                {
                    <tr class="tr-td">
                        <td>@m.TypeId.ToDescription()</td>
                        <td class="red-lg">@m.Integral</td>
                        <td>@m.RecordDate</td>
                        <td>@m.ReMark</td>
                    </tr>
                }
            </tbody>
        </table>
		
		<div class="clearfix mt10" id="bottom_pager">
			<div id="pagin-btm" class="pagin fr" style="clear:both">
				@{
					var count = ((PagingInfo)ViewBag.pageInfo).TotalPages;
					var curr = ((PagingInfo)ViewBag.pageInfo).CurrentPage;
				}
				@Html.PageLinks((PagingInfo)ViewBag.pageInfo, x => Url.Action("Index", new { pageNo = x, type = type }))
			</div>
		</div>
    </div>
    
</div>
